Accusoft.ImagXpress12.Net
Modify Alpha Channel
See Also Send Feedback
ImagXpress 12 for .NET - User Guide > How To > Process an Image > Modify Alpha Channel

Glossary Item Box

ImagXpress® supports processing alpha channel information to manage transparency in images. Alpha channels are supported for PNG, Targa, and TIFF files. While not typical, ImagXpress also supports alpha channel for BMP and ICO files. If the image is saved to a format which does not support alpha channel, the alpha channel will be dropped.

Adding Alpha Channel to an Image

To add an alpha channel to a 24-bit image, call Processor.AlphaAdd, specifying an hBitmap or bitmap with the desired alpha channel information. The Processor.Image property converts to a 32 bit image, including the new alpha channel. 

The Processor.Image must be 24-bit prior to calling Processor.AlphaAdd, or an exception is thrown.

Removing an Alpha Channel from an Image

To remove an alpha channel from a 32 bit image, call Processor.AlphaRemove method, which converts the Processor.Image to a 24-bit image without an alpha channel. The alpha channel information is not saved.

The Processor.Image must be a 32 bit image including alpha information prior to calling Processor.AlphaRemove, or an exception is thrown.

Flattening an Alpha Channel Image

Call Processor.AlphaFlatten to blend the 32 bit alpha channel plane with a specified color to create a blended 24-bit image. The resulting image has transparency information stored in the specified color within the 24-bit color spectrum.

The Processor.Image must be a 32 bit image including alpha information prior to calling Processor.AlphaFlatten, or an exception is thrown.

Reading Alpha Channel Information

To get the alpha value at a specified X and Y location in the image, call Processor.AlphaGet.

To get the entire alpha channel plane associated with the image, call Processor.GetAlphaChannelAsBitmap or GetAlphaChannelAsHBitmap. The alpha plane stores to a bitmap or HBitmap, as specified. 

Modifying Alpha Channel Information

To set an alpha value at a specified X and Y location in the image, call Processor.AlphaSet.

To modify transparency levels across the image, select one of the following options:

See Also

©2013. Accusoft Corporation. All Rights Reserved.